package gwtappcontainer.server.apps.insight;

import gwtappcontainer.server.apps.APIException;
import gwtappcontainer.shared.apis.APIResponse;

class Validator {	
					
	static void ensureValidCenter(int centerId) {
		if (centerId == 0)
			throw new APIException(APIResponse.Status.ERROR_RESOURCE_DOES_NOT_EXIST, 
					"Cannot find center with id [" + centerId + "]");
		
		if (null == CenterRepository.get(centerId))
			throw new APIException(APIResponse.Status.ERROR_RESOURCE_DOES_NOT_EXIST, 
					"Cannot find center with id [" + centerId + "]");
				
	}		
}
